import { request } from "../../request/index";
Page({
  /**
   * 页面的初始数据
   */
  data: {
    swiperList: [],
    navList:[],
    floorList:[]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    this.getSwiperList();
    this.getnavList();
    this.getFloorList()
  },
  getSwiperList() {
    request({
      url: "/home/swiperdata"
    }).then(result => {
      this.setData({
        swiperList: result
      });
    });
  },
  getnavList(){
    request({
      url:'/home/catitems'
    }).then(result=>{
      console.log(result)
      this.setData({
        navList:result
      })
    })
  },
  getFloorList(){
    request({
      url:'/home/floordata'
    }).then(result=>{
      this.setData({
        floorList:result
      })
    })
  }
});
